import math

proc squareOfSum*(n: int): int = 
  (n + n * n ) ^ 2 div 4

proc sumOfSquares*(n: int): int = 
   n * (n + 1) * (2 * n + 1) div 6

proc difference*(n: int): int =
  (n - 1) * n * (n + 1) * (3 * n + 2) div 12